#pragma once

#include "stdafx.h"
namespace lrr300 {

struct Point3D {
    double x;
    double y;
    double z;
    friend std::ostream& operator<<(std::ostream& os, const Point3D& p);
};

struct DecodedData {
    uint32_t frame_number;
    std::vector<Point3D> data;
    void clear() { data.clear(); }
};

struct DecodedData2 {
    uint32_t frame_number;
    std::vector<std::string> data;
};

class Decoder {
public:
    using DataCallBack = std::function<void(const DecodedData& data)>;
    using DataCallBack2 = std::function<void(const DecodedData2& data)>;

    static bool decode(const std::string& file, DataCallBack&& cbk);
    static bool decode_single_frame(const std::string& file, DataCallBack&& cbk);
    static bool decode_single_frame_v2(const std::string& plyfile, DataCallBack2&& cbk);
};

} // namespace lrr300